import java.util.*;

public class Project {

	private String name;
	private String description;
	private ProjectItem myTask;
	
	
	public Project(String name, String description, double rate){
		this.name=name;
		this.description=description;
	}
	
	public String getName(){
		return name;
	}
	
	public double getDuration(){
		return myTask.getTimeRequired();
	}
	
	public double getTotalCost(){
		return myTask.getCostEstimate();
	}
	
	public Map<Calendar, List<Deliverable>> allDeliverables(){
		Map<Calendar, List<Deliverable>> map = new HashMap<Calendar, List<Deliverable>>();
		Set<Deliverable> deliverables = myTask.allDeliverables();
		
		for(Deliverable it : deliverables){
			List<Deliverable> list = map.get(it.getDate());
			
			if(list==null){
				map.put(it.getDate(), list = new ArrayList<Deliverable>());	
			}
			list.add(it);
		}
		
		return map;
		
	}
	
	public void setTask(Task newTask){
		myTask=newTask;
	}
	
}
